home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
microcrn
/
issue_44.arc
/
86WRLD44.ARC
/
MSDOS.MAC
< prev
next >
Wrap
Text File
|
1980-01-01
|
1KB
|
70 lines
;***************************************************************************
;** MSDOS.MAC **
;** **
;** A set of macros and constants to help in writing programs with **
;** the MASM assembler for use under MSDOS. **
;** **
;** To use: **
;** place the line "INCLUDE MSDOS.MAC" at the beginning **
;** of you assembly language source files **
;** **
;** <lrs> 05/28/86 **
;***************************************************************************
;
; ASCII Constants
;
ctl equ -40h
CR equ ctl+'M'
LF equ ctl+'J'
EOF equ ctl+'Z'
;
; DOS Predefined Handles
;
StdIn equ 0
StdOut equ 1
StdErr equ 2
Aux equ 3
Prn equ 4
;
; A 'DOS' Instruction
;
DOS MACRO FtnNum
MOV AH,FtnNum
INT 21h
ENDM ;DOS
;
; DOS Function Numbers
;
OpenHandle equ 3Dh
Read equ 0
Write equ 1
RandW equ 2
CloseHandle equ 3Eh
ReadHandle equ 3Fh
WriteHandle equ 40h
GetVector equ 35h
SetVector equ 25h
EndF equ 4Ch
TerminateKeep equ 31h
;
; Handle Input & Output Macros
;
Input MACRO Handle, Address, Bytes
MOV BX,Handle
MOV CX,Bytes
MOV DX,offset Address
DOS ReadHandle
ENDM ;Input
Output MACRO Handle, Address, Bytes
MOV BX,Handle
MOV CX,Bytes
MOV DX,offset Address
DOS WriteHandle
ENDM ;Output
;
; end of MSDOS.MAC
;